package com.iqik.base.thread;

import java.util.ArrayList;

public class Demo02 {

    public static void main(String[] args) throws InterruptedException {
        System.out.println(1 >>> ~2);

        var arr = new ArrayList<String>();
        arr.add("s");

        arr.forEach(s->{
            System.out.println(s);
        });
    }

}

class Test {
    private int a;

    public Test(int a) {
        this.a = a;
    }

    public int getA() {
        return a;
    }

    public synchronized void sum(int num) {
        System.out.println("sum");
        for (int i = 0; i < num; i++) {
            add();
        }
    }

    public synchronized void add() {
        System.out.println("add");
        a++;
    }

    public synchronized void sub() {
        System.out.println("sub");
        a--;
    }
}

abstract class TestDemo {
    public void demo() {
        System.out.println("demo");
    }
}


interface DemoInt {

}